package com.kzc.controller;

import com.kzc.base.ResponseWrapper;
import com.kzc.bean.UserBean;
import com.kzc.mapper.user.UserMapper;
import org.apache.catalina.User;
import org.apache.ibatis.jdbc.SQL;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class TestController {

    @Autowired(required = false)
    UserMapper userMapper;

    @RequestMapping("/getUser")
    public ResponseWrapper<UserBean> getUserInfo(){

        ResponseWrapper<UserBean> responseWrapper = new ResponseWrapper<>();

        List<UserBean> list = userMapper.selectUserAll();

      //  if (list == null || list.size() == 0){
            responseWrapper.setStatus(200);
            responseWrapper.setMessage("成功");
            responseWrapper.setList(list);
    //    }


        return responseWrapper;

    }

}
